import Http from '../http';

export const menuTree = function(queryData: any) {
    return Http.get('/system/menu/tree', queryData);
}

export const menuAdd = function(formData: any) {
    return Http.post('/system/menu/add', formData);
}
export const menuRemove = function(keys: any) {
    return Http.delete('/system/menu/remove', keys);
}

export const userList = function(queryData: any) {
    return Http.get('/system/user/list', queryData);
}
export const userUnitList = function() {
    return Http.get('/system/user/units');
}
export const userAdd = function(formData: any) {
    return Http.post('/system/user/add', formData);
}
export const userRemove = function(keys: any) {
    return Http.post('/system/user/remove', keys);
}

export const roleList = function(queryData: any) {
    return Http.get('/system/role/list', queryData);
}
export const roleAdd = function(formData: any) {
    return Http.post('/system/role/add', formData);
}
export const roleRemove = function(keys: any) {
    return Http.post('/system/role/remove', keys);
}
export const roleMenuList = function(queryData: any) {
    return Http.get('/system/role/menu', queryData);
}
export const roleMenuAdd = function(roleMenu: any) {
    return Http.post('/system/role/menu/add', roleMenu);
}

export const unitTree = function() {
    return Http.get('/system/unit/tree');
}
export const unitAdd = function(data: any) {
    return Http.post('/system/unit/add', data);
}
export const unitRemove = function(keys: any) {
    return Http.delete('/system/unit/remove', keys);
}
export const unitRoles = function() {
    return Http.get('/system/unit/roles');
}
export const unitUsers = function() {
    return Http.get('/system/unit/users');
}
export const unitUserRoleAdd = function(data: any) {
    return Http.post('/system/unit/set_user_role', data);
}

export const dictList = function(queryData: any) {
    return Http.get('/system/dict/list', queryData);
}
export const dictAdd = function(formData: any) {
    return Http.post('/system/dict/add', formData);
}
export const dictRemove = function(data: any) {
    return Http.delete('/system/dict/remove', data);
}
export const dictItemAdd = function(data: any) {
    return Http.post('/system/dict/item/add', data);
}
export const dictItemRemove = function(data: any) {
    return Http.delete('/system/dict/item/remove', data);
}

export const logList = function(queryData: any) {
    return Http.get('/system/log/list', queryData);
}